import Vue from 'vue';
import VueRouter from 'vue-router';

import home from './components/tabbar/Home.vue';
import user from './components/tabbar/User.vue';
import shopcar from './components/tabbar/Shopcar.vue';
import search from './components/tabbar/Search.vue';
import newslist from './components/news/newsList.vue';
import newsinfo from './components/news/newsInfo.vue';
import share from './components/photo/share.vue';
import info from './components/photo/info.vue';
import shoplist from './components/shop/list.vue';
import shopinfo from './components/shop/info.vue';

Vue.use(VueRouter);


// 3. 创建路由对象
var router = new VueRouter({
  routes: [
    {path: '/', redirect: '/home'},
    {path: '/home', component: home},
    {path: '/user', component: user},
    {path: '/shopcar', component: shopcar},
    {path: '/search', component: search},
    {path: '/news/list', component: newslist},
    {path: '/news/info/:id', component: newsinfo},
    {path: '/photo/share', component: share},
    {path: '/photo/info:id', component: info},
    {path: '/shop/list', component:shoplist},
    {path: '/shop/shopinfo/:id', component: shopinfo, name:'shopinfo'},
  ],
  linkActiveClass:'mui-active'
})

// 把路由对象暴露出去
export default router